3.2 \(\int \tan (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=69 \[ \frac {a (B+i A) \tan (c+d x)}{d}-\frac {a (A-i B) \log (\cos (c+d x))}{d}-a x (B+i A)+\frac {i a B \tan ^2(c+d x)}{2 d} \]

[Out]

-a*(I*A+B)*x-a*(A-I*B)*ln(cos(d*x+c))/d+a*(I*A+B)*tan(d*x+c)/d+1/2*I*a*B*tan(d*x+c)^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3592, 3525, 3475} \[ \frac {a (B+i A) \tan (c+d x)}{d}-\frac {a (A-i B) \log (\cos (c+d x))}{d}-a x (B+i A)+\frac {i a B \tan ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

-(a*(I*A + B)*x) - (a*(A - I*B)*Log[Cos[c + d*x]])/d + (a*(I*A + B)*Tan[c + d*x])/d + ((I/2)*a*B*Tan[c + d*x]^
2)/d

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3592

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(B*d*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e
 + f*x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b
*c - a*d, 0] &&  !LeQ[m, -1]

Rubi steps

\begin {align*} \int \tan (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=\frac {i a B \tan ^2(c+d x)}{2 d}+\int \tan (c+d x) (a (A-i B)+a (i A+B) \tan (c+d x)) \, dx\\ &=-a (i A+B) x+\frac {a (i A+B) \tan (c+d x)}{d}+\frac {i a B \tan ^2(c+d x)}{2 d}+(a (A-i B)) \int \tan (c+d x) \, dx\\ &=-a (i A+B) x-\frac {a (A-i B) \log (\cos (c+d x))}{d}+\frac {a (i A+B) \tan (c+d x)}{d}+\frac {i a B \tan ^2(c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.31, size = 70, normalized size = 1.01 \[ \frac {a \left ((-2 B-2 i A) \tan ^{-1}(\tan (c+d x))+2 (B+i A) \tan (c+d x)-2 (A-i B) \log (\cos (c+d x))+i B \tan ^2(c+d x)\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

(a*(((-2*I)*A - 2*B)*ArcTan[Tan[c + d*x]] - 2*(A - I*B)*Log[Cos[c + d*x]] + 2*(I*A + B)*Tan[c + d*x] + I*B*Tan
[c + d*x]^2))/(2*d)

________________________________________________________________________________________

fricas [A]  time = 0.49, size = 109, normalized size = 1.58 \[ -\frac {2 \, {\left (A - 2 i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + 2 \, {\left (A - i \, B\right )} a + {\left ({\left (A - i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - i \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

-(2*(A - 2*I*B)*a*e^(2*I*d*x + 2*I*c) + 2*(A - I*B)*a + ((A - I*B)*a*e^(4*I*d*x + 4*I*c) + 2*(A - I*B)*a*e^(2*
I*d*x + 2*I*c) + (A - I*B)*a)*log(e^(2*I*d*x + 2*I*c) + 1))/(d*e^(4*I*d*x + 4*I*c) + 2*d*e^(2*I*d*x + 2*I*c) +
 d)

________________________________________________________________________________________

giac [B]  time = 0.29, size = 194, normalized size = 2.81 \[ -\frac {A a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, B a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 i \, B a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a e^{\left (2 i \, d x + 2 i \, c\right )} - 4 i \, B a e^{\left (2 i \, d x + 2 i \, c\right )} + A a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, B a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a - 2 i \, B a}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

-(A*a*e^(4*I*d*x + 4*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) - I*B*a*e^(4*I*d*x + 4*I*c)*log(e^(2*I*d*x + 2*I*c) + 1
) + 2*A*a*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) - 2*I*B*a*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*
c) + 1) + 2*A*a*e^(2*I*d*x + 2*I*c) - 4*I*B*a*e^(2*I*d*x + 2*I*c) + A*a*log(e^(2*I*d*x + 2*I*c) + 1) - I*B*a*l
og(e^(2*I*d*x + 2*I*c) + 1) + 2*A*a - 2*I*B*a)/(d*e^(4*I*d*x + 4*I*c) + 2*d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 110, normalized size = 1.59 \[ \frac {i a B \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {i a A \tan \left (d x +c \right )}{d}+\frac {a B \tan \left (d x +c \right )}{d}+\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A}{2 d}-\frac {i a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) B}{2 d}-\frac {i a A \arctan \left (\tan \left (d x +c \right )\right )}{d}-\frac {a B \arctan \left (\tan \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

1/2*I*a*B*tan(d*x+c)^2/d+I/d*a*A*tan(d*x+c)+1/d*a*B*tan(d*x+c)+1/2/d*a*ln(1+tan(d*x+c)^2)*A-1/2*I/d*a*ln(1+tan
(d*x+c)^2)*B-I/d*a*A*arctan(tan(d*x+c))-1/d*a*B*arctan(tan(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.86, size = 68, normalized size = 0.99 \[ -\frac {-i \, B a \tan \left (d x + c\right )^{2} - 2 \, {\left (d x + c\right )} {\left (-i \, A - B\right )} a - {\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - {\left (2 i \, A + 2 \, B\right )} a \tan \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(-I*B*a*tan(d*x + c)^2 - 2*(d*x + c)*(-I*A - B)*a - (A - I*B)*a*log(tan(d*x + c)^2 + 1) - (2*I*A + 2*B)*a
*tan(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 6.08, size = 59, normalized size = 0.86 \[ \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A\,a-B\,a\,1{}\mathrm {i}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (B\,a+A\,a\,1{}\mathrm {i}\right )}{d}+\frac {B\,a\,{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i),x)

[Out]

(log(tan(c + d*x) + 1i)*(A*a - B*a*1i))/d + (tan(c + d*x)*(A*a*1i + B*a))/d + (B*a*tan(c + d*x)^2*1i)/(2*d)

________________________________________________________________________________________

sympy [B]  time = 0.54, size = 116, normalized size = 1.68 \[ - \frac {a \left (A - i B\right ) \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 2 i A a - 2 B a + \left (- 2 i A a e^{2 i c} - 4 B a e^{2 i c}\right ) e^{2 i d x}}{i d e^{4 i c} e^{4 i d x} + 2 i d e^{2 i c} e^{2 i d x} + i d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

-a*(A - I*B)*log(exp(2*I*d*x) + exp(-2*I*c))/d + (-2*I*A*a - 2*B*a + (-2*I*A*a*exp(2*I*c) - 4*B*a*exp(2*I*c))*
exp(2*I*d*x))/(I*d*exp(4*I*c)*exp(4*I*d*x) + 2*I*d*exp(2*I*c)*exp(2*I*d*x) + I*d)

________________________________________________________________________________________